#include <cstdio>
#include <iostream>
using namespace std;

int main() {
	char str[31];
	char ch;
	cin >> str >> ch;
	for (int i = 0; str[i]; i++) {
		if (str[i] == ch)
			str[i] = '#';
	}

	cout << str;
	return 0;
}